import {createRouter, createWebHistory, RouteRecordRaw} from 'vue-router'

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        name: 'Home',
        component: () => import('../views/Home.vue')
    },
    {
        path: '/about',
        name: 'About',
        component: () => import('../views/About.vue')
    },
    {
        path: '/markdown',
        name: 'markdown',
        component: () => import('../views/Markdown.vue')
    },
    {
        path: '/test',
        name: 'Test',
        component: () => import('../views/Test.vue'),
        meta: {title: '测试'}
    },
    {
        path: '/dynamic/list',
        name: 'DynamicList',
        component: () => import('../views/DynamicList.vue'),
        meta: {title: '动态列表'}
    },
    {
        path: '/dynamic/:id',
        name: 'Dynamic',
        component: () => import('../views/Dynamic.vue'),
        meta: {title: '动态详情'}
    },
]

const router = createRouter({
    history: createWebHistory(import.meta.env.VITE_BASE_URL),
    routes
})


export default router
